package com.shiikong_memory.yez.MySQLAPI.Dao;

import com.shiikong_memory.yez.MySQLAPI.JavaBean.NoticeBean;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface NoticeMapper {
    @Select("select * from notice")
    List<NoticeBean> getAll();
    @Select("select * from notice where ChatChannelId=#{chatChannelId}")
    NoticeBean getByChatChannelId(@Param("chatChannelId") String chatChannelId);
    @Insert("insert into notice(ChatChannelId, ChatChannelName, GuildId, BotId)values(#{ChatChannelId},#{ChatChannelName},#{GuildId},#{BotId})")
    boolean addNotice(@Param("ChatChannelId") String ChatChannelId, @Param("ChatChannelName") String ChatChannelName, @Param("GuildId") String GuildId, @Param("BotId") String BotId);
    @Update("update notice set ChatChannelName=#{ChatChannelName} where ChatChannelId=#{ChatChannelName}")
    boolean updateByChatChannelId(@Param("ChatChannelName") String chatChannelId, @Param("ChatChannelName") String ChatChannelName);
    @Delete("delete from notice where ChatChannelId=#{ChatChannelName}")
    boolean deleteByChatChannelId(@Param("ChatChannelName") String chatChannelId);
}
